import type { Router } from "vue-router";

export function createTitleGuard(router: Router) {
  router.beforeEach((to, _from, next) => {
    if (to.meta.title) {
      document.title = import.meta.env.VITE_GLOB_APP_TITLE + " - " + to.meta.title;
    }
    next();
  });
}
